open class cQvWbqepOvFiLmsn {
    internal static var yYHjAmhheGFNDIUq: YPushOption?
    
    internal static var CspgUGspHQBOOwvM: String?
    
    internal static var ZqQfhlcqJPCpDtxY: String?

    internal static var CaJhXyBXdkPGSvsf: ((_ data: NSDictionary?) -> Void)?
    
    private init() {}
    
    public static func zIHtJDUbhYYEXeCm(option: YPushOption) {
        cQvWbqepOvFiLmsn.yYHjAmhheGFNDIUq = option
        if option.server != nil { aVvEJGjTiLCfWcNk.NyEuJqWOupFxfmWI = option.server! }
        if #available(iOS 10.0, *) {
            UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in
                if granted {
                    DispatchQueue.main.async {
                        UIApplication.shared.registerForRemoteNotifications()
                    }
                }
            }
        } else {
            UIApplication.shared.registerUserNotificationSettings(UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil))
            UIApplication.shared.registerForRemoteNotifications()
        }
    }
    
    public static func zeOWZYmISGbcjCtg(deviceToken: Data) {
        CspgUGspHQBOOwvM = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
        if CspgUGspHQBOOwvM != nil {
            iQAQNyWrpHLlofRc.wixkAWVXMAphLpQc(content: "Token inited [apple] [\(CspgUGspHQBOOwvM!)]")
        }
    }
    
    public static func uPzCEpDtsZADfrqG(alias: String?) {
        if alias != nil && alias!.count > 100 { return }
        cQvWbqepOvFiLmsn.ZqQfhlcqJPCpDtxY = (alias == nil && alias!.isEmpty ? nil : alias)
        let userDefaults = UserDefaults.standard
        let YPush_aliasID = userDefaults.string(forKey: "YPush_aliasID")
        tnBYYFXCziGIIYJa.XkrEwFxlejMKimsy(jkid: .OlCAXpRPqDSznSkU, jkparam: [
            "aliasID": YPush_aliasID == nil ? nil : YPush_aliasID!,
            "alias": cQvWbqepOvFiLmsn.ZqQfhlcqJPCpDtxY!,
            "tokens": [
                "apple": CspgUGspHQBOOwvM == nil ? nil : CspgUGspHQBOOwvM!,
            ],
        ]) { isSuccess, results in
            if !isSuccess {
                let _ = OSbFlKpozZWUgffB.ESuQDMeWJFHcuOkd(2) {
                    uPzCEpDtsZADfrqG(alias: alias)
                }
                return
            }
            if alias != nil {
                userDefaults.removeObject(forKey: "YPush_aliasID")
            } else {
                let aliasID = results!.first!["aliasID"] as! String
                userDefaults.set(aliasID, forKey: "YPush_aliasID")
            }
            iQAQNyWrpHLlofRc.wixkAWVXMAphLpQc(content: "Alias update success [\(alias!)]")
        }
    }
    
    public static func uDYRaGvNwbDcTtUW() {
        let userDefaults = UserDefaults.standard
        let YPush_aliasID = userDefaults.string(forKey: "YPush_aliasID")
        tnBYYFXCziGIIYJa.XkrEwFxlejMKimsy(jkid: .cYINEfQQSsJPZzrG, jkparam: [
            "platform": "ios",
            "aliasID": YPush_aliasID == nil ? nil : YPush_aliasID!,
        ]) { isSuccess, results in
            if !isSuccess {
                let _ = OSbFlKpozZWUgffB.ESuQDMeWJFHcuOkd(2) {
                    uDYRaGvNwbDcTtUW()
                }
                return
            }
            userDefaults.removeObject(forKey: "YPush_aliasID")
            iQAQNyWrpHLlofRc.wixkAWVXMAphLpQc(content: "removeToken success")
        }
    }
    
    public static func ZoRiOIbzFvFVHaIo(callback: ((_ data: NSDictionary?) -> Void)?) {
        CaJhXyBXdkPGSvsf = callback
    }
    
    public static func cEReOKlNbRbrYuUt(userInfo: [AnyHashable : Any]) {
        FjqpbVzuXYjGSGKp.GrAyazkWcaDIFHZB(userInfo: userInfo)
    }
}
